package com.chixigua.chaos;

import org.junit.jupiter.api.Test;

import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;


public class test {
    @Test
    public void test(){
        Date date = new Date();
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(new Date());
        calendar.set(Calendar.HOUR,
                calendar.get(Calendar.HOUR) - 1);
        Date time = calendar.getTime();
        boolean before = time.before(date);
        System.out.println(before);
    }
    @Test
    public void streamApi(){
        List<String> players= Arrays.asList("kobe","james","curry","cyyt");
        List<String> sorted= players.stream()
                .filter(s -> s.startsWith("c"))
                .map(String::toUpperCase)
                .sorted()
                .collect(Collectors.toList());
        System.out.println(sorted);
//        String[] players={"kobe","james","curry","cyyt"};
//        Stream.of(players).filter().map()
    }
}
